{"ast":null,"code":"import _defineProperty from \"@babel/runtime/helpers/esm/defineProperty\";\nimport _typeof from \"@babel/runtime/helpers/esm/typeof\";\nimport React, { cloneElement, useRef } from 'react';\nimport classNames from 'classnames';\nimport { hasAddon, hasPrefixSuffix } from \"./utils/commonUtils\";\nvar BaseInput = function BaseInput(props) {\n  var inputElement = props.inputElement,\n    prefixCls = props.prefixCls,\n    prefix = props.prefix,\n    suffix = props.suffix,\n    addonBefore = props.addonBefore,\n    addonAfter = props.addonAfter,\n    className = props.className,\n    style = props.style,\n    affixWrapperClassName = props.affixWrapperClassName,\n    groupClassName = props.groupClassName,\n    wrapperClassName = props.wrapperClassName,\n    disabled = props.disabled,\n    readOnly = props.readOnly,\n    focused = props.focused,\n    triggerFocus = props.triggerFocus,\n    allowClear = props.allowClear,\n    value = props.value,\n    handleReset = props.handleReset,\n    hidden = props.hidden;\n  var containerRef = useRef(null);\n  var onInputClick = function onInputClick(e) {\n    var _containerRef$current;\n    if ((_containerRef$current = containerRef.current) !== null && _containerRef$current !== void 0 && _containerRef$current.contains(e.target)) {\n      triggerFocus === null || triggerFocus === void 0 ? void 0 : triggerFocus();\n    }\n  }; // ================== Clear Icon ================== //\n\n  var getClearIcon = function getClearIcon() {\n    var _classNames;\n    if (!allowClear) {\n      return null;\n    }\n    var needClear = !disabled && !readOnly && value;\n    var clearIconCls = \"\".concat(prefixCls, \"-clear-icon\");\n    var iconNode = _typeof(allowClear) === 'object' && allowClear !== null && allowClear !== void 0 && allowClear.clearIcon ? allowClear.clearIcon : '✖';\n    return /*#__PURE__*/React.createElement(\"span\", {\n      onClick: handleReset // Do not trigger onBlur when clear input\n      // https://github.com/ant-design/ant-design/issues/31200\n      ,\n\n      onMouseDown: function onMouseDown(e) {\n        return e.preventDefault();\n      },\n      className: classNames(clearIconCls, (_classNames = {}, _defineProperty(_classNames, \"\".concat(clearIconCls, \"-hidden\"), !needClear), _defineProperty(_classNames, \"\".concat(clearIconCls, \"-has-suffix\"), !!suffix), _classNames)),\n      role: \"button\",\n      tabIndex: -1\n    }, iconNode);\n  };\n  var element = /*#__PURE__*/cloneElement(inputElement, {\n    value: value,\n    hidden: hidden\n  }); // ================== Prefix & Suffix ================== //\n\n  if (hasPrefixSuffix(props)) {\n    var _classNames2;\n    var affixWrapperPrefixCls = \"\".concat(prefixCls, \"-affix-wrapper\");\n    var affixWrapperCls = classNames(affixWrapperPrefixCls, (_classNames2 = {}, _defineProperty(_classNames2, \"\".concat(affixWrapperPrefixCls, \"-disabled\"), disabled), _defineProperty(_classNames2, \"\".concat(affixWrapperPrefixCls, \"-focused\"), focused), _defineProperty(_classNames2, \"\".concat(affixWrapperPrefixCls, \"-readonly\"), readOnly), _defineProperty(_classNames2, \"\".concat(affixWrapperPrefixCls, \"-input-with-clear-btn\"), suffix && allowClear && value), _classNames2), !hasAddon(props) && className, affixWrapperClassName);\n    var suffixNode = (suffix || allowClear) && /*#__PURE__*/React.createElement(\"span\", {\n      className: \"\".concat(prefixCls, \"-suffix\")\n    }, getClearIcon(), suffix);\n    element = /*#__PURE__*/React.createElement(\"span\", {\n      className: affixWrapperCls,\n      style: style,\n      hidden: !hasAddon(props) && hidden,\n      onClick: onInputClick,\n      ref: containerRef\n    }, prefix && /*#__PURE__*/React.createElement(\"span\", {\n      className: \"\".concat(prefixCls, \"-prefix\")\n    }, prefix), /*#__PURE__*/cloneElement(inputElement, {\n      style: null,\n      value: value,\n      hidden: null\n    }), suffixNode);\n  } // ================== Addon ================== //\n\n  if (hasAddon(props)) {\n    var wrapperCls = \"\".concat(prefixCls, \"-group\");\n    var addonCls = \"\".concat(wrapperCls, \"-addon\");\n    var mergedWrapperClassName = classNames(\"\".concat(prefixCls, \"-wrapper\"), wrapperCls, wrapperClassName);\n    var mergedGroupClassName = classNames(\"\".concat(prefixCls, \"-group-wrapper\"), className, groupClassName); // Need another wrapper for changing display:table to display:inline-block\n    // and put style prop in wrapper\n\n    return /*#__PURE__*/React.createElement(\"span\", {\n      className: mergedGroupClassName,\n      style: style,\n      hidden: hidden\n    }, /*#__PURE__*/React.createElement(\"span\", {\n      className: mergedWrapperClassName\n    }, addonBefore && /*#__PURE__*/React.createElement(\"span\", {\n      className: addonCls\n    }, addonBefore), /*#__PURE__*/cloneElement(element, {\n      style: null,\n      hidden: null\n    }), addonAfter && /*#__PURE__*/React.createElement(\"span\", {\n      className: addonCls\n    }, addonAfter)));\n  }\n  return element;\n};\nexport default BaseInput;","map":{"version":3,"names":["_defineProperty","_typeof","React","cloneElement","useRef","classNames","hasAddon","hasPrefixSuffix","BaseInput","props","inputElement","prefixCls","prefix","suffix","addonBefore","addonAfter","className","style","affixWrapperClassName","groupClassName","wrapperClassName","disabled","readOnly","focused","triggerFocus","allowClear","value","handleReset","hidden","containerRef","onInputClick","e","_containerRef$current","current","contains","target","getClearIcon","_classNames","needClear","clearIconCls","concat","iconNode","clearIcon","createElement","onClick","onMouseDown","preventDefault","role","tabIndex","element","_classNames2","affixWrapperPrefixCls","affixWrapperCls","suffixNode","ref","wrapperCls","addonCls","mergedWrapperClassName","mergedGroupClassName"],"sources":["/Users/poppie/Desktop/development/messenger/app/frontend/node_modules/rc-input/es/BaseInput.js"],"sourcesContent":["import _defineProperty from \"@babel/runtime/helpers/esm/defineProperty\";\nimport _typeof from \"@babel/runtime/helpers/esm/typeof\";\nimport React, { cloneElement, useRef } from 'react';\nimport classNames from 'classnames';\nimport { hasAddon, hasPrefixSuffix } from \"./utils/commonUtils\";\n\nvar BaseInput = function BaseInput(props) {\n  var inputElement = props.inputElement,\n      prefixCls = props.prefixCls,\n      prefix = props.prefix,\n      suffix = props.suffix,\n      addonBefore = props.addonBefore,\n      addonAfter = props.addonAfter,\n      className = props.className,\n      style = props.style,\n      affixWrapperClassName = props.affixWrapperClassName,\n      groupClassName = props.groupClassName,\n      wrapperClassName = props.wrapperClassName,\n      disabled = props.disabled,\n      readOnly = props.readOnly,\n      focused = props.focused,\n      triggerFocus = props.triggerFocus,\n      allowClear = props.allowClear,\n      value = props.value,\n      handleReset = props.handleReset,\n      hidden = props.hidden;\n  var containerRef = useRef(null);\n\n  var onInputClick = function onInputClick(e) {\n    var _containerRef$current;\n\n    if ((_containerRef$current = containerRef.current) !== null && _containerRef$current !== void 0 && _containerRef$current.contains(e.target)) {\n      triggerFocus === null || triggerFocus === void 0 ? void 0 : triggerFocus();\n    }\n  }; // ================== Clear Icon ================== //\n\n\n  var getClearIcon = function getClearIcon() {\n    var _classNames;\n\n    if (!allowClear) {\n      return null;\n    }\n\n    var needClear = !disabled && !readOnly && value;\n    var clearIconCls = \"\".concat(prefixCls, \"-clear-icon\");\n    var iconNode = _typeof(allowClear) === 'object' && allowClear !== null && allowClear !== void 0 && allowClear.clearIcon ? allowClear.clearIcon : '✖';\n    return /*#__PURE__*/React.createElement(\"span\", {\n      onClick: handleReset // Do not trigger onBlur when clear input\n      // https://github.com/ant-design/ant-design/issues/31200\n      ,\n      onMouseDown: function onMouseDown(e) {\n        return e.preventDefault();\n      },\n      className: classNames(clearIconCls, (_classNames = {}, _defineProperty(_classNames, \"\".concat(clearIconCls, \"-hidden\"), !needClear), _defineProperty(_classNames, \"\".concat(clearIconCls, \"-has-suffix\"), !!suffix), _classNames)),\n      role: \"button\",\n      tabIndex: -1\n    }, iconNode);\n  };\n\n  var element = /*#__PURE__*/cloneElement(inputElement, {\n    value: value,\n    hidden: hidden\n  }); // ================== Prefix & Suffix ================== //\n\n  if (hasPrefixSuffix(props)) {\n    var _classNames2;\n\n    var affixWrapperPrefixCls = \"\".concat(prefixCls, \"-affix-wrapper\");\n    var affixWrapperCls = classNames(affixWrapperPrefixCls, (_classNames2 = {}, _defineProperty(_classNames2, \"\".concat(affixWrapperPrefixCls, \"-disabled\"), disabled), _defineProperty(_classNames2, \"\".concat(affixWrapperPrefixCls, \"-focused\"), focused), _defineProperty(_classNames2, \"\".concat(affixWrapperPrefixCls, \"-readonly\"), readOnly), _defineProperty(_classNames2, \"\".concat(affixWrapperPrefixCls, \"-input-with-clear-btn\"), suffix && allowClear && value), _classNames2), !hasAddon(props) && className, affixWrapperClassName);\n    var suffixNode = (suffix || allowClear) && /*#__PURE__*/React.createElement(\"span\", {\n      className: \"\".concat(prefixCls, \"-suffix\")\n    }, getClearIcon(), suffix);\n    element = /*#__PURE__*/React.createElement(\"span\", {\n      className: affixWrapperCls,\n      style: style,\n      hidden: !hasAddon(props) && hidden,\n      onClick: onInputClick,\n      ref: containerRef\n    }, prefix && /*#__PURE__*/React.createElement(\"span\", {\n      className: \"\".concat(prefixCls, \"-prefix\")\n    }, prefix), /*#__PURE__*/cloneElement(inputElement, {\n      style: null,\n      value: value,\n      hidden: null\n    }), suffixNode);\n  } // ================== Addon ================== //\n\n\n  if (hasAddon(props)) {\n    var wrapperCls = \"\".concat(prefixCls, \"-group\");\n    var addonCls = \"\".concat(wrapperCls, \"-addon\");\n    var mergedWrapperClassName = classNames(\"\".concat(prefixCls, \"-wrapper\"), wrapperCls, wrapperClassName);\n    var mergedGroupClassName = classNames(\"\".concat(prefixCls, \"-group-wrapper\"), className, groupClassName); // Need another wrapper for changing display:table to display:inline-block\n    // and put style prop in wrapper\n\n    return /*#__PURE__*/React.createElement(\"span\", {\n      className: mergedGroupClassName,\n      style: style,\n      hidden: hidden\n    }, /*#__PURE__*/React.createElement(\"span\", {\n      className: mergedWrapperClassName\n    }, addonBefore && /*#__PURE__*/React.createElement(\"span\", {\n      className: addonCls\n    }, addonBefore), /*#__PURE__*/cloneElement(element, {\n      style: null,\n      hidden: null\n    }), addonAfter && /*#__PURE__*/React.createElement(\"span\", {\n      className: addonCls\n    }, addonAfter)));\n  }\n\n  return element;\n};\n\nexport default BaseInput;"],"mappings":"AAAA,OAAOA,eAAe,MAAM,2CAA2C;AACvE,OAAOC,OAAO,MAAM,mCAAmC;AACvD,OAAOC,KAAK,IAAIC,YAAY,EAAEC,MAAM,QAAQ,OAAO;AACnD,OAAOC,UAAU,MAAM,YAAY;AACnC,SAASC,QAAQ,EAAEC,eAAe,QAAQ,qBAAqB;AAE/D,I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